/**  
* @Title: UserCtrl.java 
* @Description:
* @Copyright: Copyright (c) 2018
* @Company:http://www.sinocon.cn
* @author Administrator  
* @date 2018年3月27日  
* @version 1.0  
*/
package com.yuanlinsu.project.system.user.ctrl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.yuanlinsu.project.system.user.entity.User;
import com.yuanlinsu.project.system.user.service.IUserService;

/**
 * @Title: UserCtrl
 * @Description:
 * @author:Administrator
 * @date 2018年3月27日
 */
@RestController
@RequestMapping("/u")
public class UserCtrl {

	private @Autowired IUserService userService;
	@GetMapping(value="/{id}/load")
	public User getUser() {
		User u = userService.selectUserById(1l);
		return u;
	}

	@GetMapping(value = "/get/{id}")
	public List<User> getAllUser(@PathVariable("id") String id) {
		User u = new User();
		u.setUserName("zhangsan");
		u.setLoginName(id);
		List<User> result = new ArrayList<User>();
		result.add(u);
		u = new User();
		u.setUserName("李四");
		result.add(u);
		return result;
	}

}
